home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
pascal
/
shazam.exe
/
GCONVERT.INT
< prev
next >
Wrap
Text File
|
1992-09-01
|
6KB
|
113 lines
{*******************************************************************
GCONVERT.INT
*******************************************************************}
{|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DATA
[X] "AutoAdjust" causes input strings to change the default
date format type to the input format.
[X] "AutoFill" causes invalid input (string or numeric) to default
to the current system date.
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||}
CONST
DateAutoAdjust : boolean = TRUE ; { set type from input }
DateAutoFill : boolean = TRUE ;
DateCentury : boolean = TRUE ;
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DATE CODES
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
dtUS = 1 ; { US mm/dd/yy }
dtUK = 2 ; { 2-UK dd.mm.yy }
dtIntl = 3 ; { 3-Int'l dd-Mmm-yy }
DateType : word = dtIntl ; { default }
TimeMode12 = FALSE ;
TimeMode24 = TRUE ;
TimeMode : boolean = TimeMode12 ;
{|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CODE
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||}
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BOOLEAN
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
function BooleanTrueFalse ( B : boolean ) : string ;
function BooleanYesNo ( B : boolean ) : string ;
function BooleanOnOff ( B : boolean ) : string ;
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CONVERT '0'-->0
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
function StrToByte ( S : string ) : byte ;
function StrToInt ( S : string ) : integer ;
function StrToWord ( S : string ) : word ;
function StrToLong ( S : string ) : longint ;
function StrToReal ( S : string ) : real ;
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CONVERT 0-->'0'
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
function NumToStr ( R : real ) : string ;
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DATE
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
procedure GetDateTime ( VAR DT : DateTime ) ;
procedure StrToDate ( S : string ; VAR DT : DateTime ) ;
function DateToStr ( DT : DateTime ; Format : word ) : string ;
function DateFormat ( S : string ; Format : word ) : string ;
function IsDateValid ( DT : DateTime ) : boolean ;
function IsDateStrValid ( S : string ) : boolean ;
procedure DateForceValid ( VAR DT : DateTime ) ;
function DayToStr ( DayOfWeek : word ) : string ;
function ToJulian ( DT : DateTime ) : longint ;
procedure FromJulian ( JulianDay : real ; VAR DT : DateTime ) ;
function DaysBetween ( DT1 , DT2 : DateTime ) : longint ;
function ZellerNum ( DT : DateTime ) : byte ;
function ZellerJulian ( R : real ) : byte ;
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TIME
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
function IsTimeValid ( DT : DateTime ) : boolean ;
procedure TimeForceValid ( VAR DT : DateTime ) ;
function TimeToStr ( DT : DateTime ; Mode24 : boolean ) : string ;
procedure StrToTime ( S : string ; VAR DT : DateTime ) ;
procedure FromTotalSeconds ( Seconds : longint ; VAR DT : DateTime ) ;
function ToTotalSeconds ( DT : DateTime ) : longint ;
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DURATION
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
function DurationToStr ( DT : DateTime ) : string ;
function SecondsBetween ( DT1 , DT2 : DateTime ) : longint ;
procedure GetDuration ( DT1 , DT2 : DateTime ; VAR Result : DateTime ) ;
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FILE
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
function GetFileDateTime ( S : PathStr ; VAR DT : DateTime ) : boolean ;
function SetFileDateTime ( S : PathStr ; VAR DT : DateTime ) : boolean ;
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
REPORT
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
function Now : string ;
function Today : string ;
function DateAndTimeToStr ( DT : DateTime ; WhichDateType : word ; Mode24 : boolean ) : string ;
function FileDateStr ( S : PathStr ; WhichDateType : word ) : string ;
function FileTimeStr ( S : PathStr ; Mode24 : boolean ) : string ;
function FileDateTimeStr ( S : PathStr ; WhichDateType : word ; Mode24 : boolean ) : string ;
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
COMPARE (-1,0,1 First greater, Equal, Second greater)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
function CompareTime ( DT1 , DT2 : DateTime ) : shortint ;
function CompareDate ( DT1 , DT2 : DateTime ) : shortint ;
function CompareDateTime ( DT1 , DT2 : DateTime ) : shortint ;
function CompareFileDateTime ( S1 , S2 : PathStr ) : shortint ;
function CompareMax ( x , y : real ) : shortint ;
function CompareMin ( x , y : real ) : shortint ;
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MAX & MIN
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
function MaxMinReal ( x , y : real ; Max : boolean ) : real ;
function MaxMinLongint ( x , y : longint ; Max : boolean ) : longint ;
function MaxMinInteger ( x , y : integer ; Max : boolean ) : integer ;
function MaxMinWord ( x , y : word ; Max : boolean ) : word ;
function MaxMinByte ( x , y : byte ; Max : boolean ) : byte ;